package com.go.where.family.service.impl;

import java.util.Date;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.go.where.family.dao.CourseDao;
import com.go.where.family.pojo.CourseInfo;
import com.go.where.family.service.CourseService;

@Service("courseService")
public class CourseServiceImpl implements CourseService {

	@Resource(name = "courseDao")
	private CourseDao courseDao;

	@Override
	public List<CourseInfo> queryList(Map<String, Object> map) {
		return courseDao.queryT(map);
	}

	@Override
	public CourseInfo queryCourseDetail(String courseId) {
		CourseInfo co = new CourseInfo();
		co.setCourseId(courseId);
		return courseDao.queryByPrimaryKey(co);
	}

	@Override
	public List<CourseInfo> queryGroupByBeginTime() {
		return courseDao.queryGroupByBeginTime();
	}

	@Override
	public List<CourseInfo> queryMonthCourseDetail(Map<String, Object> map) {
		return courseDao.queryMonthCourseDetail(map);
	}

	@Override
	public int update(CourseInfo courseInfo) {
		courseInfo.setUpdateTime(new Date());
		return courseDao.update(courseInfo);
	}

}
